package l1j.server.server.clientpackets;

import l1j.server.echo.ClientThread;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.serverpackets.S_ServerMessage;

import java.util.logging.Level;
import java.util.logging.Logger;
// Referenced classes of package l1j.server.server.clientpackets:
// ClientBasePacket

/**
 * 處理收到由客戶端傳來的查詢PK次數封包
 */
public class C_CheckPK extends ClientBasePacket {
	private static final Logger _log = Logger.getLogger(C_CheckPK.class.getName());
	private static final String C_CHECK_PK = "[C] C_CheckPK";

	@Override
	public String getType() {
		return C_CHECK_PK;
	}

	@Override
	public void start(final byte[] decrypt, final ClientThread client) {
		try {
			// 資料載入
			this.read(decrypt);

		final L1PcInstance player = client.getActiveChar();
		if (player == null) {
			return;
		}
		player.sendPackets(new S_ServerMessage(562, String.valueOf(player.get_PKcount()))); // 你的PK次數為%0次。
	} catch (final Exception e) {
		_log.log(Level.SEVERE, e.getLocalizedMessage(), e);

	} finally {
		this.over();
	}
	}

}
